package com.wc.AlgoOJ._数学.超大斐波那契数列之和1;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

/**
 * @Author congge
 * @Date 2024/7/4 10:44
 * @description http://43.138.190.70:8888/p/MA0109
 */

public class Main {
    /**
     * 思路：https://www.cnblogs.com/y1nfelix/p/15833533.html
     */
    static FastReader sc = new FastReader();
    static PrintWriter out = new PrintWriter(System.out);
    static int P = (int) 1e9 + 7;
    static long[][] base = new long[2][2];
    static long n;

    public static void main(String[] args) {
        int T = sc.nextInt();
        while (T-- > 0) {
            init();
            n = sc.nextLong();
            out.println((qkm(base, n + 2)[0][1] - 1 + P) % P);
        }
        out.flush();
    }

    static void init() {
        base = new long[][]{{0, 1}, {1, 1}};
    }

    static int[][] getE() {
        int[][] E = new int[2][2];
        E[0][0] = E[1][1] = 1;
        return E;
    }

    static long[][] qkm(long[][] a, long b) {
        b -= 1;
        long[][] res = new long[][]{{0, 1}, {0, 0}};
        while (b > 0) {
            if ((b & 1) == 1) res = mul(res, a, new long[2][2]);
            b >>= 1;
            a = mul(a, a, new long[2][2]);
        }
        return res;
    }

    static int[][] add(int[][] a, int[][] b, int[][] c) {
        for (int i = 0; i <= 1; i++) {
            for (int j = 0; j <= 1; j++) {
                c[i][j] = (a[i][j] + b[i][j]) % P;
            }
        }

        return c;
    }

    static long[][] mul(long[][] a, long[][] b, long[][] c) {
        for (int i = 0; i <= 1; i++) {
            for (int j = 0; j <= 1; j++) {
                for (int k = 0; k <= 1; k++) {
                    c[i][j] = (c[i][j] + a[i][k] * b[k][j] % P) % P;
                }
            }
        }
        return c;
    }
}

class FastReader {
    StringTokenizer st;
    BufferedReader br;

    FastReader() {
        br = new BufferedReader(new InputStreamReader(System.in));
    }

    String next() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(next());
    }

    String nextLine() {
        String s = "";
        try {
            s = br.readLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return s;
    }

    long nextLong() {
        return Long.parseLong(next());
    }

    double nextDouble() {
        return Double.parseDouble(next());
    }

    // 是否由下一个
    boolean hasNext() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                String line = br.readLine();
                if (line == null)
                    return false;
                st = new StringTokenizer(line);
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return true;
    }
}
